-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdehacked.c
More file actions
executable file
·733 lines (642 loc) · 18.7 KB
/
dehacked.c
File metadata and controls
executable file
·733 lines (642 loc) · 18.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// $Id:$
//
// Cyril Deble 1998 (cyril.deble@inforoute.cgs.fr)
//
// This source is available for distribution and/or modification
// only under the terms of the DOOM Source Code License as
// published by id Software. All rights reserved.
//
// The source is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
// for more details.
//
// DESCRIPTION:
// Doom internal dehacked file loader for amiga only :)
// 0.1 (11/02/98) First internal release
// 0.2 (15/02/98) Currently only a few options supported
// 0.3 (08/03/98) Added much more (almost all) options support
// and corrected some pointless bugs
//
//-----------------------------------------------------------------------------
static const char
rcsid[] = "$Id: dehacked.c,v 0.3 1998/03/08 23:05:00 b1 Exp $";
#include <kos.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
// Data.
#include "doomdef.h"
#include "sounds.h"
#include "m_fixed.h"
#include "doomstat.h"
#include "info.h"
#include "m_cheat.h"
#ifdef __GNUG__
#pragma implementation "info.h"
#endif
#include "info.h"
#include "p_mobj.h"
/* for ammo */
extern int clipammo[];
/* for misc */
extern int idfa_armor;
extern int idfa_armor_class;
extern int idkfa_armor;
extern int idkfa_armor_class;
extern int god_health;
extern int initial_health;
extern int initial_bullets;
extern int MAXHEALTH;
extern int max_armor;
extern int green_armor_class;
extern int blue_armor_class;
extern int maxsoul;
extern int soul_health;
extern int mega_health;
extern int BFGCELLS;
/* for cheat */
extern char cheat_mus_seq[];
extern char cheat_choppers_seq[];
extern char cheat_god_seq[];
extern char cheat_ammo_seq[];
extern char cheat_ammonokey_seq[];
extern char cheat_noclip_seq[];
extern char cheat_commercial_noclip_seq[];
extern char cheat_powerup_seq[7][10];
extern char cheat_clev_seq[];
extern char cheat_mypos_seq[];
extern char cheat_amap_seq[];
enum
{
THING_ID = 0,
THING_HIT_POINTS,
THING_SPEED,
THING_WIDTH,
THING_HEIGHT,
THING_MISSILE_DAMAGE,
THING_REACTION_TIME,
THING_PAIN_CHANCE,
THING_MASS,
THING_BITS,
THING_ALERT_SOUND,
THING_ATTACK_SOUND,
THING_PAIN_SOUND,
THING_DEATH_SOUND,
THING_ACTION_SOUND,
THING_INITIAL_FRAME,
THING_FIRST_MOVING_FRAME,
THING_INJURY_FRAME,
THING_CLOSE_ATTACK_FRAME,
THING_FAR_ATTACK_FRAME,
THING_DEATH_FRAME,
THING_EXPLODING_FRAME,
THING_RESPAWN_FRAME,
FRAME_SPRITE_NUMBER,
FRAME_SPRITE_SUBNUMBER,
FRAME_DURATION,
FRAME_NEXT_FRAME,
FRAME_UNKNOWN_1,
FRAME_UNKNOWN_2,
SPRITE_OFFSET,
AMMO_MAX_AMMO,
AMMO_PER_AMMO,
WEAPON_AMMO_TYPE,
WEAPON_DESELECT_FRAME,
WEAPON_SELECT_FRAME,
WEAPON_BOBBING_FRAME,
WEAPON_SHOOTING_FRAME,
WEAPON_FIRING_FRAME,
POINTER_CODEP_FRAME,
CHEAT_CHANGE_MUSIC,
CHEAT_CHAINSAW,
CHEAT_GOD_MODE,
CHEAT_AMMO_KEYS,
CHEAT_AMMO,
CHEAT_NO_CLIPPING_1,
CHEAT_NO_CLIPPING_2,
CHEAT_INVINCIBILITY,
CHEAT_BERSERK,
CHEAT_INVISIBILITY,
CHEAT_RADIATION_SUIT,
CHEAT_AUTO_MAP,
CHEAT_LITE_AMP_GOGGLES,
CHEAT_BEHOLD_MENU,
CHEAT_LEVEL_WARP,
CHEAT_PLAYER_POSITION,
CHEAT_MAP_CHEAT,
MISC_INITIAL_HEALTH,
MISC_INITIAL_BULLETS,
MISC_MAX_HEALTH,
MISC_MAX_ARMOR,
MISC_GREEN_ARMOR_CLASS,
MISC_BLUE_ARMOR_CLASS,
MISC_MAX_SOULSPHERE,
MISC_SOULSPHERE_HEALTH,
MISC_MEGASPHERE_HEALTH,
MISC_GOD_MODE_HEALTH,
MISC_IDFA_ARMOR,
MISC_IDFA_ARMOR_CLASS,
MISC_IDKFA_ARMOR,
MISC_IDKFA_ARMOR_CLASS,
MISC_BFG_CELLS_SHOT,
MISC_MONSTERS_INFIGHT,
NUM_KEYWORD
};
/* All keywords supported */
char *Keywords[] = {
/* Things */
"id # = ", /* mobjinfo.doomednum */
"hit points = ", /* mobjinfo.spawnhealth */
"speed = ", /* mobjinfo.speed */
"width = ", /* mobjinfo.radius */
"height = ", /* mobjinfo.height */
"missile damage = ", /* mobjinfo.damage */
"reaction time = ", /* mobjinfo.reactiontime */
"pain chance = ", /* mobjinfo.painchance */
"mass = ", /* mobjinfo.mass */
"bits = ", /* mobjinfo.flags */
"alert sound = ", /* mobjinfo.seesound */
"attack sound = ", /* mobjinfo.attacksound */
"pain sound = ", /* mobjinfo.painsound */
"death sound = ", /* mobjinfo.deathsound */
"action sound = ", /* mobjinfo.activesound */
"initial frame = ", /* mobjinfo.spawnstate */
"first moving frame = ", /* mobjinfo.seestate */
"injury frame = ", /* mobjinfo.painstate */
"close attack frame = ", /* mobjinfo.meleestate */
"far attack frame = ", /* mobjinfo.missilestate */
"death frame = ", /* mobjinfo.deathstate */
"exploding frame = ", /* mobjinfo.xdeathstate */
"respawn frame = ", /* mobjinfo.raisestate */
/* Frame */
"sprite number = ", /* states.sprite */
"sprite subnumber = ", /* states.frame */
"duration = ", /* states.tics */
"next frame = ", /* states.nextstate */
"unknown 1 = ", /* states.misc1 */
"unknown 2 = ", /* states.misc2 */
/* Sprite */
"offset =", /* supported */
/* Ammo */
"max ammo = ", /* maxammo */
"per ammo = ", /* clipammo */
/* Weapon */
"ammo type = ", /* weaponinfo.ammo */
"deselect frame = ", /* weaponinfo.upstate */
"select frame = ", /* weaponinfo.downstate */
"bobbing frame = ", /* weaponinfo.readystate */
"shooting frame = ", /* weaponinfo.atkstate */
"firing frame = ", /* weaponinfo.flashstate */
/* Pointer */
"codep frame = ", /* supported */
/* Cheat */
"change music = ", /* supported */
"chainsaw = ", /* supported */
"god mode = ", /* supported */
"ammo & keys = ", /* supported */
"ammo = ", /* supported */
"no clipping 1 = ", /* supported */
"no clipping 2 = ", /* supported */
"invincibility = ", /* supported */
"berserk = ", /* supported */
"invisibility = ", /* supported */
"radiation suit = ", /* supported */
"auto-map = ", /* supported */
"lite-amp goggles = ", /* supported */
"behold menu = ", /* supported */
"level warp = ", /* supported */
"player position = ", /* supported */
"map cheat = ", /* supported */
/* Misc */
"initial health = ", /* initial_health */
"initial bullets = ", /* initial_bullets */
"max health = ", /* maxhealth */
"max armor = ", /* max_armor */
"green armor class = ", /* green_armor_class */
"blue armor class = ", /* blue_armor_class */
"max soulsphere = ", /* maxsoul */
"soulsphere health = ", /* soul_health */
"megasphere health = ", /* mega_health */
"god mode health = ", /* god_health */
"idfa armor = ", /* idfa_armor */
"idfa armor class = ", /* idfa_armor_class */
"idkfa armor = ", /* idkfa_armor */
"idkfa armor class = ", /* idfa_armor_class */
"bfg cells/shot = ", /* bfgcells */
"monsters infight = ", /* not supported */
/* Others to follow :) */
"\n" /* The last */
};
/* Backup of action pointer */
actionf_t actions[NUMSTATES];
/* Backup of sprites names */
char * oldsprnames[NUMSPRITES];
void DE_Cheat(char *cheatseq, char* newcheat)
{
unsigned char *i,*j;
for(i=newcheat;*i!='\0';i++)
*i=SCRAMBLE(*i);
for(i=cheatseq,j=newcheat;*j!='\0' && *j!=0xff;i++,j++)
if(*i==1 || *i==0xff) // no more place in the cheat
return;
else
*i=*j;
j=i;
for(;*i!=0xff;i++)
if(*i==1)
{
*j++=1;
*j++=0;
*j++=0;
break;
}
*j=0xff;
return;
}
void DE_Text(FILE* f,int len1,int len2)
{
char s[50];
int i;
// it is hard to change all the text in doom
// here i implement only vital things
// yes text change somes tables like music, sound and sprite name
if(len1>6)
return;
if(fread(s,len1+len2,1,f))
{
for(i=0;i<108;i++)
if(!strncmp(S_sfx[i].name,s,len1))
{
strncpy(S_sfx[i].name,&(s[len1]),len2);
return;
}
for(i=0;i<NUMSPRITES;i++)
if(!strncmp(sprnames[i],s,len1))
{
strncpy(sprnames[i],&(s[len1]),len2);
return;
}
for(i=0;i<NUMSPRITES;i++)
if(!strncmp(sprnames[i],s,len1))
{
strncpy(sprnames[i],&(s[len1]),len2);
return;
}
for(i=1;i<68;i++)
if(!strncmp(S_music[i].name,s,len1))
{
strncpy(S_music[i].name,&(s[len1]),len2);
return;
}
/* more text to follow */
}
}
int
DE_Search(char *arg, char **list)
{
int i, l;
/* Make into lower case, and get length of string */
for (l = 0; *(arg + l); l++)
*(arg + l) = tolower(*(arg + l));
/*printf("arg = '%s'\n", arg);*/
for (i = 0; **(list + i) != '\n'; i++) {
/*printf("arg = '%s' list = '%s'\n", arg, *(list + i));*/
if (strstr(arg,*(list + i)))
return(i);
}
return(-1);
}
int
DE_Hack( char * line)
{
static int thing = 0;
static int frame = 0;
static int ammo = 0;
static int weapon = 0;
static int sprite = 0;
static int pointer = 0;
int choice;
char * arg;
/* scanf variables */
int n1;
char buf1[255];
/* first check for main keywords */
if(sscanf(line, "Thing %d (%s)", &n1, buf1) == 2)
{
thing = n1-1;
//buf1[strlen(buf1)-1] = '\0';
//printf("-> Changing Thing %d (%s)\n", n1, buf1);
return(1);
}
if(thing >= NUMMOBJTYPES) return(0);
if(sscanf(line, "Frame %d", &n1) == 1)
{
frame = n1;
//printf("-> Changing Frame %d\n", n1);
return(1);
}
if(frame >= NUMSTATES) return(0);
if(sscanf(line, "Pointer %d", &n1) == 1)
{
pointer = n1;
//printf("-> Changing Pointer %d\n", n1);
return(1);
}
if(pointer >= NUMSTATES) return(0);
if(sscanf(line, "Ammo %d", &n1) == 1)
{
ammo = n1;
//printf("-> Changing Ammo %d\n", n1);
return(1);
}
if(ammo >= NUMAMMO) return(0);
if(sscanf(line, "Cheat %d", &n1) == 1)
{
//printf("-> Changing Cheat\n");
return(1);
}
if(sscanf(line, "Weapon %d", &n1) == 1)
{
weapon = n1;
//printf("-> Changing Weapon %d\n", n1);
return(1);
}
if(weapon >= NUMWEAPONS) return(0);
if(sscanf(line, "Sprite %d", &n1) == 1)
{
sprite = n1;
//printf("-> Changing Sprite %d\n", n1);
return(1);
}
if(sprite >= NUMSPRITES) return(0);
if(sscanf(line, "Misc %d", &n1) == 1)
{
//printf("-> Changing Misc\n");
return(1);
}
/* search for option */
choice = DE_Search(line, Keywords);
// if(choice < 0 || choice > NUM_KEYWORD-1) return(0);
if((choice < 0) || (choice > NUM_KEYWORD-1))
return 0;
arg = strstr(line, Keywords[choice]) +
strlen(Keywords[choice]);
/*printf("Choice = %d, Arg = %s\n", choice, arg);*/
switch(choice)
{
case THING_ID:
mobjinfo[thing].doomednum = atoi(arg);
break;
case THING_HIT_POINTS:
mobjinfo[thing].spawnhealth = atoi(arg);
break;
case THING_SPEED:
mobjinfo[thing].speed = atoi(arg);
break;
case THING_WIDTH:
mobjinfo[thing].radius = atoi(arg);
break;
case THING_HEIGHT:
mobjinfo[thing].height = atoi(arg);
break;
case THING_MISSILE_DAMAGE:
mobjinfo[thing].damage = atoi(arg);
break;
case THING_REACTION_TIME:
mobjinfo[thing].reactiontime = atoi(arg);
break;
case THING_PAIN_CHANCE:
mobjinfo[thing].painchance = atoi(arg);
break;
case THING_MASS:
mobjinfo[thing].mass = atoi(arg);
break;
case THING_BITS:
mobjinfo[thing].flags = atoi(arg);
break;
case THING_ALERT_SOUND:
mobjinfo[thing].seesound = atoi(arg);
break;
case THING_ATTACK_SOUND:
mobjinfo[thing].attacksound = atoi(arg);
break;
case THING_PAIN_SOUND:
mobjinfo[thing].painsound = atoi(arg);
break;
case THING_DEATH_SOUND:
mobjinfo[thing].deathsound = atoi(arg);
break;
case THING_ACTION_SOUND:
mobjinfo[thing].activesound = atoi(arg);
break;
case THING_INITIAL_FRAME:
mobjinfo[thing].spawnstate = atoi(arg);
break;
case THING_FIRST_MOVING_FRAME:
mobjinfo[thing].seestate = atoi(arg);
break;
case THING_INJURY_FRAME:
mobjinfo[thing].painstate = atoi(arg);
break;
case THING_CLOSE_ATTACK_FRAME:
mobjinfo[thing].meleestate = atoi(arg);
break;
case THING_FAR_ATTACK_FRAME:
mobjinfo[thing].missilestate = atoi(arg);
break;
case THING_DEATH_FRAME:
mobjinfo[thing].deathstate = atoi(arg);
break;
case THING_EXPLODING_FRAME:
mobjinfo[thing].xdeathstate = atoi(arg);
break;
case THING_RESPAWN_FRAME:
mobjinfo[thing].raisestate = atoi(arg);
break;
case FRAME_SPRITE_NUMBER:
states[frame].sprite = atoi(arg);
break;
case FRAME_SPRITE_SUBNUMBER:
states[frame].frame = atoi(arg);
break;
case FRAME_DURATION:
states[frame].tics = atoi(arg);
break;
case FRAME_NEXT_FRAME:
states[frame].nextstate = atoi(arg);
break;
case FRAME_UNKNOWN_1:
states[frame].misc1 = atoi(arg);
break;
case FRAME_UNKNOWN_2:
states[frame].misc2 = atoi(arg);
break;
case WEAPON_AMMO_TYPE:
weaponinfo[weapon].ammo = atoi(arg);
break;
case WEAPON_DESELECT_FRAME:
weaponinfo[weapon].upstate = atoi(arg);
break;
case WEAPON_SELECT_FRAME:
weaponinfo[weapon].downstate = atoi(arg);
break;
case WEAPON_BOBBING_FRAME:
weaponinfo[weapon].readystate = atoi(arg);
break;
case WEAPON_SHOOTING_FRAME:
weaponinfo[weapon].atkstate = atoi(arg);
break;
case WEAPON_FIRING_FRAME:
weaponinfo[weapon].flashstate = atoi(arg);
break;
case AMMO_MAX_AMMO:
maxammo[ammo] = atoi(arg);
break;
case AMMO_PER_AMMO:
clipammo[ammo] = atoi(arg);
break;
case CHEAT_CHANGE_MUSIC:
DE_Cheat(cheat_mus_seq,arg);
break;
case CHEAT_CHAINSAW:
DE_Cheat(cheat_choppers_seq,arg);
break;
case CHEAT_GOD_MODE:
DE_Cheat(cheat_god_seq,arg);
break;
case CHEAT_AMMO_KEYS:
DE_Cheat(cheat_ammonokey_seq,arg);
break;
case CHEAT_AMMO:
DE_Cheat(cheat_ammo_seq,arg);
break;
case CHEAT_NO_CLIPPING_1:
DE_Cheat(cheat_noclip_seq,arg);
break;
case CHEAT_NO_CLIPPING_2:
DE_Cheat(cheat_commercial_noclip_seq,arg);
break;
case CHEAT_INVINCIBILITY:
DE_Cheat(cheat_powerup_seq[0],arg);
break;
case CHEAT_BERSERK:
DE_Cheat(cheat_powerup_seq[1],arg);
break;
case CHEAT_INVISIBILITY:
DE_Cheat(cheat_powerup_seq[2],arg);
break;
case CHEAT_RADIATION_SUIT:
DE_Cheat(cheat_powerup_seq[3],arg);
break;
case CHEAT_AUTO_MAP:
DE_Cheat(cheat_powerup_seq[4],arg);
break;
case CHEAT_LITE_AMP_GOGGLES:
DE_Cheat(cheat_powerup_seq[5],arg);
break;
case CHEAT_BEHOLD_MENU:
DE_Cheat(cheat_powerup_seq[6],arg);
break;
case CHEAT_LEVEL_WARP:
DE_Cheat(cheat_clev_seq,arg);
break;
case CHEAT_PLAYER_POSITION:
DE_Cheat(cheat_mypos_seq,arg);
break;
case CHEAT_MAP_CHEAT:
DE_Cheat(cheat_amap_seq,arg);
break;
case MISC_INITIAL_HEALTH:
initial_health = atoi(arg);
break;
case MISC_INITIAL_BULLETS:
initial_bullets = atoi(arg);
break;
case MISC_MAX_HEALTH:
MAXHEALTH = atoi(arg);
break;
case MISC_MAX_ARMOR:
max_armor = atoi(arg);
break;
case MISC_GREEN_ARMOR_CLASS:
green_armor_class = atoi(arg);
break;
case MISC_BLUE_ARMOR_CLASS:
blue_armor_class = atoi(arg);
break;
case MISC_MAX_SOULSPHERE:
maxsoul = atoi(arg);
break;
case MISC_SOULSPHERE_HEALTH:
soul_health = atoi(arg);
break;
case MISC_MEGASPHERE_HEALTH:
mega_health = atoi(arg);
break;
case MISC_GOD_MODE_HEALTH:
god_health = atoi(arg);
break;
case MISC_IDFA_ARMOR:
idfa_armor = atoi(arg);
break;
case MISC_IDFA_ARMOR_CLASS:
idfa_armor_class = atoi(arg);
break;
case MISC_IDKFA_ARMOR:
idkfa_armor = atoi(arg);
break;
case MISC_IDKFA_ARMOR_CLASS:
idfa_armor_class = atoi(arg);
break;
case MISC_BFG_CELLS_SHOT:
BFGCELLS = atoi(arg);
break;
case SPRITE_OFFSET:
sprnames[sprite]=oldsprnames[(atoi(arg)-151328)/8];
case POINTER_CODEP_FRAME:
states[frame].action = actions[atoi(arg)];
default:
return(0);
}
return(1);
}
void
DE_AddDeh(char * name)
{
FILE *fp;
char text[255];
printf("DE_AddDeh: Adding %s\n", name);
if((fp = fopen(name,"r")))
{
int i;
/* Backup all action pointer */
for(i=0;i<NUMSTATES;i++)
actions[i] = states[i].action;
/* Backup all sprite name pointer */
for(i=0;i<NUMSPRITES;i++)
oldsprnames[i] = sprnames[i];
/* Start parsing the file */
while(fgets(text, 255, fp))
{
int len1 = 0, len2 = 0;
text[strlen(text)-1] = '\0';
if(text[0] == '#') continue;
if(text[0] == '\n') continue;
/* Check for text or hack */
if(sscanf(text, "Text %d %d", &len1, &len2) == 2)
DE_Text(fp, len1, len2);
else
DE_Hack(text);
}
fclose(fp);
}
else
{
printf("Dehacked file '%s' not found\nPress ENTER to continue\n", name);
getchar();
}
}