Subversion Repositories eduke32

Rev

Rev 5050 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5050 Rev 5062
1
//-------------------------------------------------------------------------
1
//-------------------------------------------------------------------------
2
/*
2
/*
3
Copyright (C) 2010 EDuke32 developers and contributors
3
Copyright (C) 2010 EDuke32 developers and contributors
4

4

5
This file is part of EDuke32.
5
This file is part of EDuke32.
6

6

7
EDuke32 is free software; you can redistribute it and/or
7
EDuke32 is free software; you can redistribute it and/or
8
modify it under the terms of the GNU General Public License version 2
8
modify it under the terms of the GNU General Public License version 2
9
as published by the Free Software Foundation.
9
as published by the Free Software Foundation.
10

10

11
This program is distributed in the hope that it will be useful,
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14

14

15
See the GNU General Public License for more details.
15
See the GNU General Public License for more details.
16

16

17
You should have received a copy of the GNU General Public License
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20
*/
20
*/
21
//-------------------------------------------------------------------------
21
//-------------------------------------------------------------------------
22
22
23
#include "compat.h"
23
#include "compat.h"
24
#include "baselayer.h"
24
#include "baselayer.h"
25
25
26
#include "scriptfile.h"
26
#include "scriptfile.h"
27
#include "cache1d.h"
27
#include "cache1d.h"
28
#include "crc32.h"
28
#include "crc32.h"
29
29
30
#include "duke3d.h"
30
#include "duke3d.h"
31
#include "common_game.h"
31
#include "common_game.h"
32
#include "grpscan.h"
32
#include "grpscan.h"
33
33
-
 
34
static void process_vaca13(void);
-
 
35
static void process_vacapp15(void);
-
 
36
34
// custom GRP support for the startup window, file format reflects the structure below
37
// custom GRP support for the startup window, file format reflects the structure below
35
#define GAMELISTFILE "games.list"
38
#define GAMELISTFILE "games.list"
36
//    name                                     crc          size      flags                         dependency  scriptname     defname
39
//    name                                     crc          size      flags                         dependency  scriptname     defname           postprocessing
37
struct grpfile internalgrpfiles[NUMGRPFILES] =
40
struct grpfile internalgrpfiles[] =
38
{
41
{
39
    { "Duke Nukem 3D",                         DUKE13_CRC,  26524524, GAMEFLAG_DUKE,                         0, NULL,          NULL,        NULL },
42
    { "Duke Nukem 3D",                         DUKE13_CRC,  26524524, GAMEFLAG_DUKE,                         0, NULL, NULL, NULL, NULL },
40
    { "Duke Nukem 3D (South Korean Censored)", DUKEKR_CRC,  26385383, GAMEFLAG_DUKE,                         0, NULL,          NULL,        NULL },
43
    { "Duke Nukem 3D (South Korean Censored)", DUKEKR_CRC,  26385383, GAMEFLAG_DUKE,                         0, NULL, NULL, NULL, NULL },
41
    { "Duke Nukem 3D: Atomic Edition",         DUKE15_CRC,  44356548, GAMEFLAG_DUKE,                         0, NULL,          NULL,        NULL },
44
    { "Duke Nukem 3D: Atomic Edition",         DUKE15_CRC,  44356548, GAMEFLAG_DUKE,                         0, NULL, NULL, NULL, NULL },
42
    { "Duke Nukem 3D: Plutonium Pak",          DUKEPP_CRC,  44348015, GAMEFLAG_DUKE,                         0, NULL,          NULL,        NULL },
45
    { "Duke Nukem 3D: Plutonium Pak",          DUKEPP_CRC,  44348015, GAMEFLAG_DUKE,                         0, NULL, NULL, NULL, NULL },
43
    { "Duke Nukem 3D Shareware 0.99",          DUKE099_CRC, 9690241,  GAMEFLAG_DUKE|GAMEFLAG_DUKEBETA,       0, NULL,          NULL,        NULL },
46
    { "Duke Nukem 3D Shareware 0.99",          DUKE099_CRC, 9690241,  GAMEFLAG_DUKE|GAMEFLAG_DUKEBETA,       0, NULL, NULL, NULL, NULL },
44
    { "Duke Nukem 3D Shareware 1.0",           DUKE10_CRC,  10429258, GAMEFLAG_DUKE|GAMEFLAG_SHAREWARE,      0, NULL,          NULL,        NULL },
47
    { "Duke Nukem 3D Shareware 1.0",           DUKE10_CRC,  10429258, GAMEFLAG_DUKE|GAMEFLAG_SHAREWARE,      0, NULL, NULL, NULL, NULL },
45
    { "Duke Nukem 3D Shareware 1.1",           DUKE11_CRC,  10442980, GAMEFLAG_DUKE|GAMEFLAG_SHAREWARE,      0, NULL,          NULL,        NULL },
48
    { "Duke Nukem 3D Shareware 1.1",           DUKE11_CRC,  10442980, GAMEFLAG_DUKE|GAMEFLAG_SHAREWARE,      0, NULL, NULL, NULL, NULL },
46
    { "Duke Nukem 3D Shareware 1.3D",          DUKESW_CRC,  11035779, GAMEFLAG_DUKE|GAMEFLAG_SHAREWARE,      0, NULL,          NULL,        NULL },
49
    { "Duke Nukem 3D Shareware 1.3D",          DUKESW_CRC,  11035779, GAMEFLAG_DUKE|GAMEFLAG_SHAREWARE,      0, NULL, NULL, NULL, NULL },
47
    { "Duke Nukem 3D Mac Demo",                DUKEMD_CRC,  10444391, GAMEFLAG_DUKE|GAMEFLAG_SHAREWARE,      0, NULL,          NULL,        NULL },
50
    { "Duke Nukem 3D Mac Demo",                DUKEMD_CRC,  10444391, GAMEFLAG_DUKE|GAMEFLAG_SHAREWARE,      0, NULL, NULL, NULL, NULL },
-
 
51
    { "Duke it out in D.C. (1.3D)",            DUKEDC13_CRC, 7926624, GAMEFLAG_DUKE|GAMEFLAG_ADDON, DUKE13_CRC, NULL, NULL, NULL, NULL },
-
 
52
    { "Duke it out in D.C.",                   DUKEDCPP_CRC, 8225517, GAMEFLAG_DUKE|GAMEFLAG_ADDON, DUKE15_CRC, NULL, NULL, NULL, NULL },
48
    { "Duke it out in D.C.",                   DUKEDC_CRC,  8410183 , GAMEFLAG_DUKE|GAMEFLAG_ADDON, DUKE15_CRC, NULL,          NULL,        NULL },
53
    { "Duke it out in D.C.",                   DUKEDC_CRC,  8410183,  GAMEFLAG_DUKE|GAMEFLAG_ADDON, DUKE15_CRC, NULL, NULL, NULL, NULL },
-
 
54
    { "Duke Caribbean: Life's a Beach (1.3D)", VACA13_CRC,  23559381, GAMEFLAG_DUKE|GAMEFLAG_ADDON, DUKE13_CRC, NULL, NULL, process_vaca13, NULL },
-
 
55
    { "Duke Caribbean: Life's a Beach (PPak)", VACAPP_CRC,  22551333, GAMEFLAG_DUKE|GAMEFLAG_ADDON, DUKEPP_CRC, NULL, NULL, process_vacapp15, NULL },
-
 
56
    { "Duke Caribbean: Life's a Beach",        VACA15_CRC,  22521880, GAMEFLAG_DUKE|GAMEFLAG_ADDON, DUKE15_CRC, NULL, NULL, process_vacapp15, NULL },
49
    { "Duke Caribbean: Life's a Beach",        DUKECB_CRC,  22213819, GAMEFLAG_DUKE|GAMEFLAG_ADDON, DUKE15_CRC, NULL,          NULL,        NULL },
57
    { "Duke Caribbean: Life's a Beach",        DUKECB_CRC,  22213819, GAMEFLAG_DUKE|GAMEFLAG_ADDON, DUKE15_CRC, NULL, NULL, NULL, NULL },
50
    { "Duke: Nuclear Winter",                  DUKENW_CRC,  16169365, GAMEFLAG_DUKE|GAMEFLAG_ADDON|GAMEFLAG_NWINTER, DUKE15_CRC, "NWINTER.CON", NULL,        NULL },
58
    { "Duke: Nuclear Winter",                  DUKENW_CRC,  16169365, GAMEFLAG_DUKE|GAMEFLAG_ADDON|GAMEFLAG_NWINTER, DUKE15_CRC, "NWINTER.CON", NULL, NULL, NULL },
51
    { "NAM",                                   NAM_CRC,     43448927, GAMEFLAG_NAM,                          0, NULL,          NULL,        NULL },
59
    { "NAM",                                   NAM_CRC,     43448927, GAMEFLAG_NAM,                          0, NULL, NULL, NULL, NULL },
52
    { "NAPALM",                                NAPALM_CRC,  44365728, GAMEFLAG_NAM|GAMEFLAG_NAPALM,          0, NULL,          NULL,        NULL },
60
    { "NAPALM",                                NAPALM_CRC,  44365728, GAMEFLAG_NAM|GAMEFLAG_NAPALM,          0, NULL, NULL, NULL, NULL },
53
    { "WWII GI",                               WW2GI_CRC,   77939508, GAMEFLAG_WW2GI|GAMEFLAG_NAM,           0, NULL,          NULL,        NULL },
61
    { "WWII GI",                               WW2GI_CRC,   77939508, GAMEFLAG_WW2GI|GAMEFLAG_NAM,           0, NULL, NULL, NULL, NULL },
54
};
62
};
55
struct grpfile *foundgrps = NULL;
63
struct grpfile *foundgrps = NULL;
56
struct grpfile *listgrps = NULL;
64
struct grpfile *listgrps = NULL;
57
65
58
static void LoadList(const char * filename)
66
static void LoadList(const char * filename)
59
{
67
{
60
    struct grpfile *fg;
68
    struct grpfile *fg;
61
69
62
    char *grpend = NULL;
70
    char *grpend = NULL;
63
71
64
    scriptfile *script = scriptfile_fromfile(filename);
72
    scriptfile *script = scriptfile_fromfile(filename);
65
73
66
    if (!script)
74
    if (!script)
67
        return;
75
        return;
68
76
69
    scriptfile_addsymbolvalue("GAMEFLAG_DUKE", GAMEFLAG_DUKE);
77
    scriptfile_addsymbolvalue("GAMEFLAG_DUKE", GAMEFLAG_DUKE);
70
    scriptfile_addsymbolvalue("GAMEFLAG_ADDON", GAMEFLAG_DUKE|GAMEFLAG_ADDON);
78
    scriptfile_addsymbolvalue("GAMEFLAG_ADDON", GAMEFLAG_DUKE|GAMEFLAG_ADDON);
71
    scriptfile_addsymbolvalue("GAMEFLAG_NAM", GAMEFLAG_NAM);
79
    scriptfile_addsymbolvalue("GAMEFLAG_NAM", GAMEFLAG_NAM);
72
    scriptfile_addsymbolvalue("GAMEFLAG_NAPALM", GAMEFLAG_NAM|GAMEFLAG_NAPALM);
80
    scriptfile_addsymbolvalue("GAMEFLAG_NAPALM", GAMEFLAG_NAM|GAMEFLAG_NAPALM);
73
    scriptfile_addsymbolvalue("GAMEFLAG_WW2GI", GAMEFLAG_NAM|GAMEFLAG_WW2GI);
81
    scriptfile_addsymbolvalue("GAMEFLAG_WW2GI", GAMEFLAG_NAM|GAMEFLAG_WW2GI);
74
    scriptfile_addsymbolvalue("DUKE15_CRC", DUKE15_CRC);
82
    scriptfile_addsymbolvalue("DUKE15_CRC", DUKE15_CRC);
75
    scriptfile_addsymbolvalue("DUKEPP_CRC", DUKEPP_CRC);
83
    scriptfile_addsymbolvalue("DUKEPP_CRC", DUKEPP_CRC);
76
    scriptfile_addsymbolvalue("DUKE13_CRC", DUKE13_CRC);
84
    scriptfile_addsymbolvalue("DUKE13_CRC", DUKE13_CRC);
-
 
85
    scriptfile_addsymbolvalue("DUKEDC13_CRC", DUKEDC13_CRC);
-
 
86
    scriptfile_addsymbolvalue("DUKEDCPP_CRC", DUKEDCPP_CRC);
77
    scriptfile_addsymbolvalue("DUKEDC_CRC", DUKEDC_CRC);
87
    scriptfile_addsymbolvalue("DUKEDC_CRC", DUKEDC_CRC);
-
 
88
    scriptfile_addsymbolvalue("VACA13_CRC", VACA13_CRC);
-
 
89
    scriptfile_addsymbolvalue("VACAPP_CRC", VACAPP_CRC);
-
 
90
    scriptfile_addsymbolvalue("VACA15_CRC", VACA15_CRC);
78
    scriptfile_addsymbolvalue("DUKECB_CRC", DUKECB_CRC);
91
    scriptfile_addsymbolvalue("DUKECB_CRC", DUKECB_CRC);
79
    scriptfile_addsymbolvalue("DUKENW_CRC", DUKENW_CRC);
92
    scriptfile_addsymbolvalue("DUKENW_CRC", DUKENW_CRC);
80
    scriptfile_addsymbolvalue("NAM_CRC", NAM_CRC);
93
    scriptfile_addsymbolvalue("NAM_CRC", NAM_CRC);
81
    scriptfile_addsymbolvalue("NAPALM_CRC", NAPALM_CRC);
94
    scriptfile_addsymbolvalue("NAPALM_CRC", NAPALM_CRC);
82
    scriptfile_addsymbolvalue("WW2GI_CRC", WW2GI_CRC);
95
    scriptfile_addsymbolvalue("WW2GI_CRC", WW2GI_CRC);
83
96
84
    while (!scriptfile_eof(script))
97
    while (!scriptfile_eof(script))
85
    {
98
    {
86
        enum
99
        enum
87
        {
100
        {
88
            T_GRPINFO,
101
            T_GRPINFO,
89
            T_GAMENAME,
102
            T_GAMENAME,
90
            T_CRC,
103
            T_CRC,
91
            T_SIZE,
104
            T_SIZE,
92
            T_DEPCRC,
105
            T_DEPCRC,
93
            T_SCRIPTNAME,
106
            T_SCRIPTNAME,
94
            T_DEFNAME,
107
            T_DEFNAME,
95
            T_FLAGS,
108
            T_FLAGS,
96
        };
109
        };
97
110
98
        static const tokenlist profiletokens[] =
111
        static const tokenlist profiletokens[] =
99
        {
112
        {
100
            { "grpinfo",            T_GRPINFO },
113
            { "grpinfo",            T_GRPINFO },
101
        };
114
        };
102
115
103
        int32_t token = getatoken(script,profiletokens,ARRAY_SIZE(profiletokens));
116
        int32_t token = getatoken(script,profiletokens,ARRAY_SIZE(profiletokens));
104
        switch (token)
117
        switch (token)
105
        {
118
        {
106
        case T_GRPINFO:
119
        case T_GRPINFO:
107
        {
120
        {
108
            int32_t gsize = 0, gcrcval = 0, gflags = GAMEFLAG_DUKE, gdepcrc = DUKE15_CRC;
121
            int32_t gsize = 0, gcrcval = 0, gflags = GAMEFLAG_DUKE, gdepcrc = DUKE15_CRC;
109
            char *gname = NULL, *gscript = NULL, *gdef = NULL;
122
            char *gname = NULL, *gscript = NULL, *gdef = NULL;
110
123
111
            static const tokenlist grpinfotokens[] =
124
            static const tokenlist grpinfotokens[] =
112
            {
125
            {
113
                { "name",           T_GAMENAME },
126
                { "name",           T_GAMENAME },
114
                { "scriptname",     T_SCRIPTNAME },
127
                { "scriptname",     T_SCRIPTNAME },
115
                { "defname",        T_DEFNAME },
128
                { "defname",        T_DEFNAME },
116
                { "crc",            T_CRC },
129
                { "crc",            T_CRC },
117
                { "dependency",     T_DEPCRC },
130
                { "dependency",     T_DEPCRC },
118
                { "size",           T_SIZE },
131
                { "size",           T_SIZE },
119
                { "flags",          T_FLAGS },
132
                { "flags",          T_FLAGS },
120
133
121
            };
134
            };
122
135
123
            if (scriptfile_getbraces(script,&grpend)) break;
136
            if (scriptfile_getbraces(script,&grpend)) break;
124
137
125
            while (script->textptr < grpend)
138
            while (script->textptr < grpend)
126
            {
139
            {
127
                int32_t token = getatoken(script,grpinfotokens,ARRAY_SIZE(grpinfotokens));
140
                int32_t token = getatoken(script,grpinfotokens,ARRAY_SIZE(grpinfotokens));
128
141
129
                switch (token)
142
                switch (token)
130
                {
143
                {
131
                case T_GAMENAME:
144
                case T_GAMENAME:
132
                    scriptfile_getstring(script,&gname); break;
145
                    scriptfile_getstring(script,&gname); break;
133
                case T_SCRIPTNAME:
146
                case T_SCRIPTNAME:
134
                    scriptfile_getstring(script,&gscript); break;
147
                    scriptfile_getstring(script,&gscript); break;
135
                case T_DEFNAME:
148
                case T_DEFNAME:
136
                    scriptfile_getstring(script,&gdef); break;
149
                    scriptfile_getstring(script,&gdef); break;
137
150
138
                case T_FLAGS:
151
                case T_FLAGS:
139
                    scriptfile_getsymbol(script,&gflags); gflags &= GAMEFLAGMASK; break;
152
                    scriptfile_getsymbol(script,&gflags); gflags &= GAMEFLAGMASK; break;
140
                case T_DEPCRC:
153
                case T_DEPCRC:
141
                    scriptfile_getsymbol(script,&gdepcrc); break;
154
                    scriptfile_getsymbol(script,&gdepcrc); break;
142
                case T_CRC:
155
                case T_CRC:
143
                    scriptfile_getsymbol(script,&gcrcval); break;
156
                    scriptfile_getsymbol(script,&gcrcval); break;
144
                case T_SIZE:
157
                case T_SIZE:
145
                    scriptfile_getnumber(script,&gsize); break;
158
                    scriptfile_getnumber(script,&gsize); break;
146
                default:
159
                default:
147
                    break;
160
                    break;
148
                }
161
                }
149
162
150
                fg = (struct grpfile *)Xcalloc(1, sizeof(struct grpfile));
163
                fg = (struct grpfile *)Xcalloc(1, sizeof(struct grpfile));
151
                fg->next = listgrps;
164
                fg->next = listgrps;
152
                listgrps = fg;
165
                listgrps = fg;
153
166
154
                if (gname)
167
                if (gname)
155
                    fg->name = Xstrdup(gname);
168
                    fg->name = Xstrdup(gname);
156
169
157
                fg->size = gsize;
170
                fg->size = gsize;
158
                fg->crcval = gcrcval;
171
                fg->crcval = gcrcval;
159
                fg->dependency = gdepcrc;
172
                fg->dependency = gdepcrc;
160
                fg->game = gflags;
173
                fg->game = gflags;
161
174
162
                if (gscript)
175
                if (gscript)
163
                    fg->scriptname = dup_filename(gscript);
176
                    fg->scriptname = dup_filename(gscript);
164
177
165
                if (gdef)
178
                if (gdef)
166
                    fg->defname = dup_filename(gdef);
179
                    fg->defname = dup_filename(gdef);
167
            }
180
            }
168
            break;
181
            break;
169
        }
182
        }
170
183
171
        default:
184
        default:
172
            break;
185
            break;
173
        }
186
        }
174
    }
187
    }
175
188
176
    scriptfile_close(script);
189
    scriptfile_close(script);
177
    scriptfile_clearsymbols();
190
    scriptfile_clearsymbols();
178
}
191
}
179
192
180
static void LoadGameList(void)
193
static void LoadGameList(void)
181
{
194
{
182
    struct grpfile *fg;
195
    struct grpfile *fg;
183
    CACHE1D_FIND_REC *srch, *sidx;
196
    CACHE1D_FIND_REC *srch, *sidx;
184
   
197
185
    int32_t i;
-
 
186
-
 
187
    for (i = 0; i<NUMGRPFILES; i++)
198
    for (size_t i = 0; i < ARRAY_SIZE(internalgrpfiles); i++)
188
    {
199
    {
189
        fg = (struct grpfile *)Xcalloc(1, sizeof(struct grpfile));
200
        fg = (struct grpfile *)Xcalloc(1, sizeof(struct grpfile));
190
201
191
        fg->name = Xstrdup(internalgrpfiles[i].name);
202
        fg->name = Xstrdup(internalgrpfiles[i].name);
192
        fg->crcval = internalgrpfiles[i].crcval;
203
        fg->crcval = internalgrpfiles[i].crcval;
193
        fg->size = internalgrpfiles[i].size;
204
        fg->size = internalgrpfiles[i].size;
194
        fg->game = internalgrpfiles[i].game;
205
        fg->game = internalgrpfiles[i].game;
195
        fg->dependency = internalgrpfiles[i].dependency;
206
        fg->dependency = internalgrpfiles[i].dependency;
196
207
197
        if (internalgrpfiles[i].scriptname)
208
        if (internalgrpfiles[i].scriptname)
198
            fg->scriptname = dup_filename(internalgrpfiles[i].scriptname);
209
            fg->scriptname = dup_filename(internalgrpfiles[i].scriptname);
199
210
200
        if (internalgrpfiles[i].defname)
211
        if (internalgrpfiles[i].defname)
201
            fg->defname = dup_filename(internalgrpfiles[i].defname);
212
            fg->defname = dup_filename(internalgrpfiles[i].defname);
202
213
-
 
214
        fg->postprocessing = internalgrpfiles[i].postprocessing;
-
 
215
203
        fg->next = listgrps;
216
        fg->next = listgrps;
204
        listgrps = fg;
217
        listgrps = fg;
205
    }
218
    }
206
219
207
    srch = klistpath("/", "*.grpinfo", CACHE1D_FIND_FILE);
220
    srch = klistpath("/", "*.grpinfo", CACHE1D_FIND_FILE);
208
221
209
    for (sidx = srch; sidx; sidx = sidx->next)
222
    for (sidx = srch; sidx; sidx = sidx->next)
210
        LoadList(srch->name);
223
        LoadList(srch->name);
211
224
212
    klistfree(srch);
225
    klistfree(srch);
213
}
226
}
214
227
215
static void FreeGameList(void)
228
static void FreeGameList(void)
216
{
229
{
217
    struct grpfile *fg;
230
    struct grpfile *fg;
218
231
219
    while (listgrps)
232
    while (listgrps)
220
    {
233
    {
221
        fg = listgrps->next;
234
        fg = listgrps->next;
222
        Bfree(listgrps->name);
235
        Bfree(listgrps->name);
223
236
224
        if (listgrps->scriptname)
237
        if (listgrps->scriptname)
225
            Bfree(listgrps->scriptname);
238
            Bfree(listgrps->scriptname);
226
239
227
        if (listgrps->defname)
240
        if (listgrps->defname)
228
            Bfree(listgrps->defname);
241
            Bfree(listgrps->defname);
229
242
230
        Bfree(listgrps);
243
        Bfree(listgrps);
231
        listgrps = fg;
244
        listgrps = fg;
232
    }
245
    }
233
}
246
}
234
247
235
248
236
#define GRPCACHEFILE "grpfiles.cache"
249
#define GRPCACHEFILE "grpfiles.cache"
237
static struct grpcache
250
static struct grpcache
238
{
251
{
239
    struct grpcache *next;
252
    struct grpcache *next;
240
    int32_t size;
253
    int32_t size;
241
    int32_t mtime;
254
    int32_t mtime;
242
    int32_t crcval;
255
    int32_t crcval;
243
    char name[BMAX_PATH];
256
    char name[BMAX_PATH];
244
}
257
}
245
*grpcache = NULL, *usedgrpcache = NULL;
258
*grpcache = NULL, *usedgrpcache = NULL;
246
259
247
static int32_t LoadGroupsCache(void)
260
static int32_t LoadGroupsCache(void)
248
{
261
{
249
    struct grpcache *fg;
262
    struct grpcache *fg;
250
263
251
    int32_t fsize, fmtime, fcrcval;
264
    int32_t fsize, fmtime, fcrcval;
252
    char *fname;
265
    char *fname;
253
266
254
    scriptfile *script;
267
    scriptfile *script;
255
268
256
    script = scriptfile_fromfile(GRPCACHEFILE);
269
    script = scriptfile_fromfile(GRPCACHEFILE);
257
    if (!script) return -1;
270
    if (!script) return -1;
258
271
259
    while (!scriptfile_eof(script))
272
    while (!scriptfile_eof(script))
260
    {
273
    {
261
        if (scriptfile_getstring(script, &fname)) break;    // filename
274
        if (scriptfile_getstring(script, &fname)) break;    // filename
262
        if (scriptfile_getnumber(script, &fsize)) break;    // filesize
275
        if (scriptfile_getnumber(script, &fsize)) break;    // filesize
263
        if (scriptfile_getnumber(script, &fmtime)) break;   // modification time
276
        if (scriptfile_getnumber(script, &fmtime)) break;   // modification time
264
        if (scriptfile_getnumber(script, &fcrcval)) break;  // crc checksum
277
        if (scriptfile_getnumber(script, &fcrcval)) break;  // crc checksum
265
278
266
        fg = (struct grpcache *)Xcalloc(1, sizeof(struct grpcache));
279
        fg = (struct grpcache *)Xcalloc(1, sizeof(struct grpcache));
267
        fg->next = grpcache;
280
        fg->next = grpcache;
268
        grpcache = fg;
281
        grpcache = fg;
269
282
270
        Bstrncpy(fg->name, fname, BMAX_PATH);
283
        Bstrncpy(fg->name, fname, BMAX_PATH);
271
        fg->size = fsize;
284
        fg->size = fsize;
272
        fg->mtime = fmtime;
285
        fg->mtime = fmtime;
273
        fg->crcval = fcrcval;
286
        fg->crcval = fcrcval;
274
    }
287
    }
275
288
276
    scriptfile_close(script);
289
    scriptfile_close(script);
277
    return 0;
290
    return 0;
278
}
291
}
279
292
280
static void FreeGroupsCache(void)
293
static void FreeGroupsCache(void)
281
{
294
{
282
    struct grpcache *fg;
295
    struct grpcache *fg;
283
296
284
    while (grpcache)
297
    while (grpcache)
285
    {
298
    {
286
        fg = grpcache->next;
299
        fg = grpcache->next;
287
        Bfree(grpcache);
300
        Bfree(grpcache);
288
        grpcache = fg;
301
        grpcache = fg;
289
    }
302
    }
290
}
303
}
291
304
292
void RemoveGroup(int32_t crcval)
305
void RemoveGroup(int32_t crcval)
293
{
306
{
294
    struct grpfile *grp;
307
    struct grpfile *grp;
295
308
296
    for (grp = foundgrps; grp; grp=grp->next)
309
    for (grp = foundgrps; grp; grp=grp->next)
297
    {
310
    {
298
        if (grp->crcval == crcval)
311
        if (grp->crcval == crcval)
299
        {
312
        {
300
            if (grp == foundgrps)
313
            if (grp == foundgrps)
301
                foundgrps = grp->next;
314
                foundgrps = grp->next;
302
            else
315
            else
303
            {
316
            {
304
                struct grpfile *fg;
317
                struct grpfile *fg;
305
318
306
                for (fg = foundgrps; fg; fg=fg->next)
319
                for (fg = foundgrps; fg; fg=fg->next)
307
                {
320
                {
308
                    if (fg->next == grp)
321
                    if (fg->next == grp)
309
                    {
322
                    {
310
                        fg->next = grp->next;
323
                        fg->next = grp->next;
311
                        break;
324
                        break;
312
                    }
325
                    }
313
                }
326
                }
314
            }
327
            }
315
328
316
            Bfree((char *)grp->name);
329
            Bfree((char *)grp->name);
317
            Bfree(grp);
330
            Bfree(grp);
318
331
319
            RemoveGroup(crcval);
332
            RemoveGroup(crcval);
320
333
321
            break;
334
            break;
322
        }
335
        }
323
    }
336
    }
324
}
337
}
325
338
326
struct grpfile * FindGroup(int32_t crcval)
339
struct grpfile * FindGroup(int32_t crcval)
327
{
340
{
328
    struct grpfile *grp;
341
    struct grpfile *grp;
329
342
330
    for (grp = foundgrps; grp; grp=grp->next)
343
    for (grp = foundgrps; grp; grp=grp->next)
331
    {
344
    {
332
        if (grp->crcval == crcval)
345
        if (grp->crcval == crcval)
333
            return grp;
346
            return grp;
334
    }
347
    }
335
348
336
    return NULL;
349
    return NULL;
337
}
350
}
338
351
339
int32_t ScanGroups(void)
352
static void ProcessGroups(CACHE1D_FIND_REC *srch)
340
{
353
{
341
    CACHE1D_FIND_REC *srch, *sidx;
354
    CACHE1D_FIND_REC *sidx;
342
    struct grpcache *fg, *fgg;
355
    struct grpcache *fg, *fgg;
343
    struct grpfile *grp;
356
    struct grpfile *grp;
344
    char *fn;
357
    char *fn;
345
    struct Bstat st;
358
    struct Bstat st;
-
 
359
346
#define BUFFER_SIZE (1024 * 1024 * 8)
360
#define BUFFER_SIZE (1024 * 1024 * 8)
347
    uint8_t *buf = (uint8_t *)Xmalloc(BUFFER_SIZE);
361
    uint8_t *buf = (uint8_t *)Xmalloc(BUFFER_SIZE);
348
362
349
    initprintf("Searching for game data...\n");
-
 
350
-
 
351
    LoadGameList();
-
 
352
    LoadGroupsCache();
-
 
353
-
 
354
    srch = klistpath("/", "*.grp", CACHE1D_FIND_FILE);
-
 
355
-
 
356
    for (sidx = srch; sidx; sidx = sidx->next)
363
    for (sidx = srch; sidx; sidx = sidx->next)
357
    {
364
    {
358
        for (fg = grpcache; fg; fg = fg->next)
365
        for (fg = grpcache; fg; fg = fg->next)
359
        {
366
        {
360
            if (!Bstrcmp(fg->name, sidx->name)) break;
367
            if (!Bstrcmp(fg->name, sidx->name)) break;
361
        }
368
        }
362
369
363
        if (fg)
370
        if (fg)
364
        {
371
        {
365
            if (findfrompath(sidx->name, &fn)) continue; // failed to resolve the filename
372
            if (findfrompath(sidx->name, &fn)) continue; // failed to resolve the filename
366
            if (Bstat(fn, &st))
373
            if (Bstat(fn, &st))
367
            {
374
            {
368
                Bfree(fn);
375
                Bfree(fn);
369
                continue;
376
                continue;
370
            } // failed to stat the file
377
            } // failed to stat the file
371
            Bfree(fn);
378
            Bfree(fn);
372
            if (fg->size == (int32_t)st.st_size && fg->mtime == (int32_t)st.st_mtime)
379
            if (fg->size == (int32_t)st.st_size && fg->mtime == (int32_t)st.st_mtime)
373
            {
380
            {
374
                grp = (struct grpfile *)Xcalloc(1, sizeof(struct grpfile));
381
                grp = (struct grpfile *)Xcalloc(1, sizeof(struct grpfile));
375
                grp->name = Xstrdup(sidx->name);
382
                grp->name = Xstrdup(sidx->name);
376
                grp->crcval = fg->crcval;
383
                grp->crcval = fg->crcval;
377
                grp->size = fg->size;
384
                grp->size = fg->size;
378
                grp->next = foundgrps;
385
                grp->next = foundgrps;
379
                foundgrps = grp;
386
                foundgrps = grp;
380
387
381
                fgg = (struct grpcache *)Xcalloc(1, sizeof(struct grpcache));
388
                fgg = (struct grpcache *)Xcalloc(1, sizeof(struct grpcache));
382
                strcpy(fgg->name, fg->name);
389
                strcpy(fgg->name, fg->name);
383
                fgg->size = fg->size;
390
                fgg->size = fg->size;
384
                fgg->mtime = fg->mtime;
391
                fgg->mtime = fg->mtime;
385
                fgg->crcval = fg->crcval;
392
                fgg->crcval = fg->crcval;
386
                fgg->next = usedgrpcache;
393
                fgg->next = usedgrpcache;
387
                usedgrpcache = fgg;
394
                usedgrpcache = fgg;
388
                continue;
395
                continue;
389
            }
396
            }
390
        }
397
        }
391
398
392
        {
399
        {
393
            int32_t b, fh;
400
            int32_t b, fh;
394
            int32_t crcval = 0;
401
            int32_t crcval = 0;
395
402
396
            fh = openfrompath(sidx->name, BO_RDONLY|BO_BINARY, BS_IREAD);
403
            fh = openfrompath(sidx->name, BO_RDONLY|BO_BINARY, BS_IREAD);
397
            if (fh < 0) continue;
404
            if (fh < 0) continue;
398
            if (Bfstat(fh, &st)) continue;
405
            if (Bfstat(fh, &st)) continue;
399
406
400
            initprintf(" Checksumming %s...", sidx->name);
407
            initprintf(" Checksumming %s...", sidx->name);
401
            do
408
            do
402
            {
409
            {
403
                b = read(fh, buf, BUFFER_SIZE);
410
                b = read(fh, buf, BUFFER_SIZE);
404
                if (b > 0) crcval = Bcrc32((uint8_t *)buf, b, crcval);
411
                if (b > 0) crcval = Bcrc32((uint8_t *)buf, b, crcval);
405
            }
412
            }
406
            while (b == BUFFER_SIZE);
413
            while (b == BUFFER_SIZE);
407
            close(fh);
414
            close(fh);
408
            initprintf(" Done\n");
415
            initprintf(" Done\n");
409
416
410
            grp = (struct grpfile *)Xcalloc(1, sizeof(struct grpfile));
417
            grp = (struct grpfile *)Xcalloc(1, sizeof(struct grpfile));
411
            grp->name = Xstrdup(sidx->name);
418
            grp->name = Xstrdup(sidx->name);
412
            grp->crcval = crcval;
419
            grp->crcval = crcval;
413
            grp->size = st.st_size;
420
            grp->size = st.st_size;
414
            grp->next = foundgrps;
421
            grp->next = foundgrps;
415
            foundgrps = grp;
422
            foundgrps = grp;
416
423
417
            fgg = (struct grpcache *)Xcalloc(1, sizeof(struct grpcache));
424
            fgg = (struct grpcache *)Xcalloc(1, sizeof(struct grpcache));
418
            Bstrncpy(fgg->name, sidx->name, BMAX_PATH);
425
            Bstrncpy(fgg->name, sidx->name, BMAX_PATH);
419
            fgg->size = st.st_size;
426
            fgg->size = st.st_size;
420
            fgg->mtime = st.st_mtime;
427
            fgg->mtime = st.st_mtime;
421
            fgg->crcval = crcval;
428
            fgg->crcval = crcval;
422
            fgg->next = usedgrpcache;
429
            fgg->next = usedgrpcache;
423
            usedgrpcache = fgg;
430
            usedgrpcache = fgg;
424
        }
431
        }
425
    }
432
    }
426
433
-
 
434
    Bfree(buf);
-
 
435
}
-
 
436
-
 
437
int32_t ScanGroups(void)
-
 
438
{
-
 
439
    CACHE1D_FIND_REC *srch;
-
 
440
    struct grpcache *fg, *fgg;
-
 
441
    struct grpfile *grp;
-
 
442
-
 
443
    initprintf("Searching for game data...\n");
-
 
444
-
 
445
    LoadGameList();
-
 
446
    LoadGroupsCache();
-
 
447
-
 
448
    srch = klistpath("/", "*.grp", CACHE1D_FIND_FILE);
-
 
449
    ProcessGroups(srch);
427
    klistfree(srch);
450
    klistfree(srch);
-
 
451
-
 
452
    srch = klistpath("/", "*.ssi", CACHE1D_FIND_FILE);
-
 
453
    ProcessGroups(srch);
-
 
454
    klistfree(srch);
-
 
455
428
    FreeGroupsCache();
456
    FreeGroupsCache();
429
457
430
    for (grp = foundgrps; grp; /*grp=grp->next*/)
458
    for (grp = foundgrps; grp; /*grp=grp->next*/)
431
    {
459
    {
432
        struct grpfile *igrp;
460
        struct grpfile *igrp;
433
        for (igrp = listgrps; igrp; igrp=igrp->next)
461
        for (igrp = listgrps; igrp; igrp=igrp->next)
434
            if (grp->crcval == igrp->crcval) break;
462
            if (grp->crcval == igrp->crcval) break;
435
463
436
        if (igrp == NULL)
464
        if (igrp == NULL)
437
        {
465
        {
438
            grp = grp->next;
466
            grp = grp->next;
439
            continue;
467
            continue;
440
        }
468
        }
441
469
442
        if (igrp->dependency)
470
        if (igrp->dependency)
443
        {
471
        {
444
            struct grpfile *depgrp;
472
            struct grpfile *depgrp;
445
473
446
            //initprintf("found grp with dep\n");
474
            //initprintf("found grp with dep\n");
447
            for (depgrp = foundgrps; depgrp; depgrp=depgrp->next)
475
            for (depgrp = foundgrps; depgrp; depgrp=depgrp->next)
448
                if (depgrp->crcval == igrp->dependency) break;
476
                if (depgrp->crcval == igrp->dependency) break;
449
477
450
            if (depgrp == NULL || depgrp->crcval != igrp->dependency) // couldn't find dependency
478
            if (depgrp == NULL || depgrp->crcval != igrp->dependency) // couldn't find dependency
451
            {
479
            {
452
                //initprintf("removing %s\n", grp->name);
480
                //initprintf("removing %s\n", grp->name);
453
                RemoveGroup(igrp->crcval);
481
                RemoveGroup(igrp->crcval);
454
                grp = foundgrps;
482
                grp = foundgrps;
455
                continue;
483
                continue;
456
            }
484
            }
457
        }
485
        }
458
486
459
        if (igrp->game && !grp->game)
487
        if (igrp->game && !grp->game)
460
            grp->game = igrp->game;
488
            grp->game = igrp->game;
461
489
462
        grp=grp->next;
490
        grp=grp->next;
463
    }
491
    }
464
492
465
    if (usedgrpcache)
493
    if (usedgrpcache)
466
    {
494
    {
467
        int32_t i = 0;
495
        int32_t i = 0;
468
        FILE *fp;
496
        FILE *fp;
469
        fp = fopen(GRPCACHEFILE, "wt");
497
        fp = fopen(GRPCACHEFILE, "wt");
470
        if (fp)
498
        if (fp)
471
        {
499
        {
472
            for (fg = usedgrpcache; fg; fg=fgg)
500
            for (fg = usedgrpcache; fg; fg=fgg)
473
            {
501
            {
474
                fgg = fg->next;
502
                fgg = fg->next;
475
                fprintf(fp, "\"%s\" %d %d %d\n", fg->name, fg->size, fg->mtime, fg->crcval);
503
                fprintf(fp, "\"%s\" %d %d %d\n", fg->name, fg->size, fg->mtime, fg->crcval);
476
                Bfree(fg);
504
                Bfree(fg);
477
                i++;
505
                i++;
478
            }
506
            }
479
            fclose(fp);
507
            fclose(fp);
480
        }
508
        }
481
//        initprintf("Found %d recognized GRP %s.\n",i,i>1?"files":"file");
509
//        initprintf("Found %d recognized GRP %s.\n",i,i>1?"files":"file");
482
510
483
        Bfree(buf);
-
 
484
        return 0;
511
        return 0;
485
    }
512
    }
486
513
487
    initprintf("Found no recognized game data!\n");
514
    initprintf("Found no recognized game data!\n");
488
515
489
    Bfree(buf);
-
 
490
    return 0;
516
    return 0;
491
}
517
}
492
518
493
519
494
void FreeGroups(void)
520
void FreeGroups(void)
495
{
521
{
496
    struct grpfile *fg;
522
    struct grpfile *fg;
497
523
498
    while (foundgrps)
524
    while (foundgrps)
499
    {
525
    {
500
        fg = foundgrps->next;
526
        fg = foundgrps->next;
501
        Bfree((char *)foundgrps->name);
527
        Bfree((char *)foundgrps->name);
502
        Bfree(foundgrps);
528
        Bfree(foundgrps);
503
        foundgrps = fg;
529
        foundgrps = fg;
504
    }
530
    }
505
531
506
    FreeGameList();
532
    FreeGameList();
507
}
533
}
508
534
-
 
535
static void process_vaca13(void)
-
 
536
{
-
 
537
    krename("ADDREE.COV", "ADDREE.VOC");
-
 
538
    krename("BALLBOOM.COV", "BALLBOOM.VOC");
-
 
539
    krename("BARMUSIC.COV", "BARMUSIC.VOC");
-
 
540
    krename("BCHBALL.COV", "BCHBALL.VOC");
-
 
541
    krename("BOING.COV", "BOING.VOC");
-
 
542
    krename("CHACHA.COV", "CHACHA.VOC");
-
 
543
    krename("CHAINDRV.COV", "CHAINDRV.VOC");
-
 
544
    krename("CHEAP01.COV", "CHEAP01.VOC");
-
 
545
    krename("CHEER.COV", "CHEER.VOC");
-
 
546
    krename("CHNSQRT.COV", "CHNSQRT.VOC");
-
 
547
    krename("COCOANUT.COV", "COCOANUT.VOC");
-
 
548
    krename("CRUSH2.COV", "CRUSH2.VOC");
-
 
549
    krename("DEFLATE2.COV", "DEFLATE2.VOC");
-
 
550
    krename("DRAGHURT.COV", "DRAGHURT.VOC");
-
 
551
    krename("DRAGROAM.COV", "DRAGROAM.VOC");
-
 
552
    krename("DRAGSHOT.COV", "DRAGSHOT.VOC");
-
 
553
    krename("DUKE01.COV", "DUKE01.VOC");
-
 
554
    krename("ELEV1.COV", "ELEV1.VOC");
-
 
555
    krename("GMEOVR05.COV", "GMEOVR05.VOC");
-
 
556
    krename("GULLDIE.COV", "GULLDIE.VOC");
-
 
557
    krename("GULLHURT.COV", "GULLHURT.VOC");
-
 
558
    krename("GULLROAM.COV", "GULLROAM.VOC");
-
 
559
    krename("GULLSHIT.COV", "GULLSHIT.VOC");
-
 
560
    krename("HELP04.COV", "HELP04.VOC");
-
 
561
    krename("ICECONCH.COV", "ICECONCH.VOC");
-
 
562
    krename("IDLEBOAT.COV", "IDLEBOAT.VOC");
-
 
563
    krename("KICKHEAD.COV", "KICKHEAD.VOC");
-
 
564
    krename("LANI05.COV", "LANI05.VOC");
-
 
565
    krename("LANI08.COV", "LANI08.VOC");
-
 
566
    krename("LANIDUK2.COV", "LANIDUK2.VOC");
-
 
567
    krename("MUSCLE01.COV", "MUSCLE01.VOC");
-
 
568
    krename("MUSCLE04.COV", "MUSCLE04.VOC");
-
 
569
    krename("MUZAK.COV", "MUZAK.VOC");
-
 
570
    krename("PINEFALL.COV", "PINEFALL.VOC");
-
 
571
    krename("POINT07.COV", "POINT07.VOC");
-
 
572
    krename("POINT08.COV", "POINT08.VOC");
-
 
573
    krename("RADIO.COV", "RADIO.VOC");
-
 
574
    krename("RUIN01.COV", "RUIN01.VOC");
-
 
575
    krename("SCREAM.COV", "SCREAM.VOC");
-
 
576
    krename("SCREAM04.COV", "SCREAM04.VOC");
-
 
577
    krename("SCREAM9.COV", "SCREAM9.VOC");
-
 
578
    krename("SHIPHORN.COV", "SHIPHORN.VOC");
-
 
579
    krename("SNGLGULL.COV", "SNGLGULL.VOC");
-
 
580
    krename("SQRT4.COV", "SQRT4.VOC");
-
 
581
    krename("SQUIRT1.COV", "SQUIRT1.VOC");
-
 
582
    krename("SSCOOL1.COV", "SSCOOL1.VOC");
-
 
583
    krename("SSCOOL2.COV", "SSCOOL2.VOC");
-
 
584
    krename("SSCOOL3.COV", "SSCOOL3.VOC");
-
 
585
    krename("SSDIE1.COV", "SSDIE1.VOC");
-
 
586
    krename("SSDIE2.COV", "SSDIE2.VOC");
-
 
587
    krename("SSNORM01.COV", "SSNORM01.VOC");
-
 
588
    krename("SSNORM02.COV", "SSNORM02.VOC");
-
 
589
    krename("SSNORM03.COV", "SSNORM03.VOC");
-
 
590
    krename("SSNORM04.COV", "SSNORM04.VOC");
-
 
591
    krename("SSNORM05.COV", "SSNORM05.VOC");
-
 
592
    krename("SSNORM06.COV", "SSNORM06.VOC");
-
 
593
    krename("SSNORM07.COV", "SSNORM07.VOC");
-
 
594
    krename("SSNORM08.COV", "SSNORM08.VOC");
-
 
595
    krename("SSNORM10.COV", "SSNORM10.VOC");
-
 
596
    krename("SSNORM11.COV", "SSNORM11.VOC");
-
 
597
    krename("SSNORM12.COV", "SSNORM12.VOC");
-
 
598
    krename("SSNORM13.COV", "SSNORM13.VOC");
-
 
599
    krename("SSNORM14.COV", "SSNORM14.VOC");
-
 
600
    krename("SSNORM15.COV", "SSNORM15.VOC");
-
 
601
    krename("SSNORM16.COV", "SSNORM16.VOC");
-
 
602
    krename("SSNORM17.COV", "SSNORM17.VOC");
-
 
603
    krename("SSNORM18.COV", "SSNORM18.VOC");
-
 
604
    krename("SSNORM19.COV", "SSNORM19.VOC");
-
 
605
    krename("SSNORM20.COV", "SSNORM20.VOC");
-
 
606
    krename("SSTAUNT1.COV", "SSTAUNT1.VOC");
-
 
607
    krename("SSTAUNT2.COV", "SSTAUNT2.VOC");
-
 
608
    krename("SSTAUNT3.COV", "SSTAUNT3.VOC");
-
 
609
    krename("SSTAUNT4.COV", "SSTAUNT4.VOC");
-
 
610
    krename("SSTAUNT5.COV", "SSTAUNT5.VOC");
-
 
611
    krename("SSTAUNT6.COV", "SSTAUNT6.VOC");
-
 
612
    krename("SSTAUNT7.COV", "SSTAUNT7.VOC");
-
 
613
    krename("SSTAUNT8.COV", "SSTAUNT8.VOC");
-
 
614
    krename("SURF.COV", "SURF.VOC");
-
 
615
    krename("TAN01.COV", "TAN01.VOC");
-
 
616
    krename("TAN04.COV", "TAN04.VOC");
-
 
617
    krename("VINESNAP.COV", "VINESNAP.VOC");
-
 
618
    krename("VOODRUMS.COV", "VOODRUMS.VOC");
-
 
619
    krename("WIND54.COV", "WIND54.VOC");
-
 
620
    krename("DOOMSDAY.DIM", "DOOMSDAY.MID");
-
 
621
    krename("DUKE-O.DIM", "DUKE-O.MID");
-
 
622
    krename("IRIEPRTY.DIM", "IRIEPRTY.MID");
-
 
623
    krename("JUNGVEIN.DIM", "JUNGVEIN.MID");
-
 
624
    krename("PRTYCRUZ.DIM", "PRTYCRUZ.MID");
-
 
625
    krename("SOL-MAN1.DIM", "SOL-MAN1.MID");
-
 
626
    krename("CINEOV3.MNA", "CINEOV3.ANM");
-
 
627
    krename("DUKETEAM.MNA", "DUKETEAM.ANM");
-
 
628
    krename("BEACHBAB.NOC", "BEACHBAB.CON");
-
 
629
    krename("BEACHBAL.NOC", "BEACHBAL.CON");
-
 
630
    krename("BEACHBTH.NOC", "BEACHBTH.CON");
-
 
631
    krename("DEFS.NOC", "DEFS.CON");
-
 
632
    krename("DRAGON.NOC", "DRAGON.CON");
-
 
633
    krename("GAME.NOC", "GAME.CON");
-
 
634
    krename("SEAGULL.NOC", "SEAGULL.CON");
-
 
635
    krename("SOUNDS.NOC", "SOUNDS.CON");
-
 
636
    krename("USER.NOC", "USER.CON");
-
 
637
    krename("DEMO1.OMD", "DEMO1.DMO");
-
 
638
    krename("DEMO2.OMD", "DEMO2.DMO");
-
 
639
    krename("DEMO3.OMD", "DEMO3.DMO");
-
 
640
    krename("VACA1.PAM", "VACA1.MAP");
-
 
641
    krename("VACA2.PAM", "VACA2.MAP");
-
 
642
    krename("VACA3.PAM", "VACA3.MAP");
-
 
643
    krename("VACA4.PAM", "VACA4.MAP");
-
 
644
    krename("VACA5.PAM", "VACA5.MAP");
-
 
645
    krename("VACA6.PAM", "VACA6.MAP");
-
 
646
    krename("VACA7.PAM", "VACA7.MAP");
-
 
647
    krename("VACADM1.PAM", "VACADM1.MAP");
-
 
648
    krename("VACADM2.PAM", "VACADM2.MAP");
-
 
649
    krename("VACADM3.PAM", "VACADM3.MAP");
-
 
650
    krename("VACADM4.PAM", "VACADM4.MAP");
-
 
651
    krename("VACASL.PAM", "VACASL.MAP");
-
 
652
    krename("TILES000.TRA", "TILES000.ART");
-
 
653
    krename("TILES001.TRA", "TILES001.ART");
-
 
654
    krename("TILES003.TRA", "TILES003.ART");
-
 
655
    krename("TILES005.TRA", "TILES005.ART");
-
 
656
    krename("TILES006.TRA", "TILES006.ART");
-
 
657
    krename("TILES007.TRA", "TILES007.ART");
-
 
658
    krename("TILES008.TRA", "TILES008.ART");
-
 
659
    krename("TILES009.TRA", "TILES009.ART");
-
 
660
    krename("TILES010.TRA", "TILES010.ART");
-
 
661
    krename("TILES012.TRA", "TILES012.ART");
-
 
662
    krename("TILES014.TRA", "TILES014.ART");
-
 
663
}
-
 
664
-
 
665
static void process_vacapp15(void)
-
 
666
{
-
 
667
    krename("DEFS.NOC", "DEFS.CON");
-
 
668
    krename("GAME.NOC", "GAME.CON");
-
 
669
    krename("USER.NOC", "USER.CON");
-
 
670
    krename("DEMO1.OMD", "DEMO1.DMO");
-
 
671
    krename("DEMO2.OMD", "DEMO2.DMO");
-
 
672
    krename("DEMO3.OMD", "DEMO3.DMO");
-
 
673
-
 
674
    initgroupfile("VACATION.PRG");
-
 
675
}
509
 
676